package com.lf.web.service.system.user;

import com.lf.data.search.Query;
import com.lf.web.service.ResponseCode;
import com.lf.web.service.ResponseInfo;
import com.lf.web.service.ServiceSupport;
import org.apache.log4j.Logger;

public class UserRemoveService extends ServiceSupport {

    private static final Logger LOGGER = Logger.getLogger(UserRemoveService.class);
    private UserDAO userDAO;
    private String id = "";

    public void setUserDAO(UserDAO userDAO) {
        this.userDAO = userDAO;
    }

    public String execute() {
        id = form.getString("id");
        LOGGER.debug("删除用户：id=" + id);
        Query query = new Query();
        query.eq(User.ID, id);
        query.idEQ(id);
        userDAO.remove(query);
        ResponseInfo msg = new ResponseInfo(ResponseCode.FINISH);
        out(msg);
        return NONE;
    }
}
